// 导入fs
const fs = require('fs')

// 读取文件
function firstFile() {
    return new Promise((resolve, reject) => {
        fs.readFile(__dirname + '/files/first.txt', (err, data) => {
            if (err) reject(err)
            resolve(data)
        })
    })
}

function secondFile() {
    return new Promise((resolve, reject) => {
        fs.readFile(__dirname + '/files/second.txt', (err, data) => {
            if (err) reject(err)
            resolve(data)
        })
    })
}

function thirdFile() {
    return new Promise((resolve, reject) => {
        fs.readFile(__dirname + '/files/third.txt', (err, data) => {
            if (err) reject(err)
            resolve(data)
        })
    })
}

// 声明一个async函数
async function fun() {
    let firstContent=await firstFile();
    let secondContent=await secondFile();
    let thirdContent=await thirdFile();
    console.log(firstContent.toString(),secondContent.toString(),thirdContent.toString())
}
fun()